import service from "../utils/request";

export function addFlowTemplate(fromData) {
  return service({
    url: `/template/addTemplate`,
    method: "post",
    data: fromData,
  });
}

export function getFlowTemplate() {
  return service({
    url: `/api/getFlowTemplate`,
    method: "get",
    params: data,
  });
}

export function getFlowData(data) {
  return service({
    url: `/template/getPageData`,
    method: "get",
    params: data,
  });
}

//获取流程审批详情
export function getFlowInstanceInfo(data) {
  return service({
    url: `/flow/instanceInfo`,
    method: "get",
    params: data,
  });
}

//同意审批
export function flowAgree(fromData) {
  return service({
    url: `/flow/agree`,
    method: "post",
    data: fromData,
  });
}

//拒绝审批
export function flowReject(fromData) {
    return service({
      url: `/flow/reject`,
      method: "post",
      data: fromData,
    });
  }

export function getFlowDataInfo(data) {
  return service({
    url: `/flow/getFlowDetail`,
    method: "get",
    params: data,
  });
}

//发起流程
export function flowStart(fromData) {
  return service({
    url: `/flow/flowStart`,
    method: "post",
    data: fromData,
  });
}

//获取待办
export function getFlowToDoList(data) {
  return service({
    url: `/flow/toDoList`,
    method: "get",
    params: data,
  });
}

//获取已办
export function getFlowDoneList(data) {
  return service({
    url: `/flow/doneList`,
    method: "get",
    params: data,
  });
}


// export function getFlowData(data) {
//   return service({
//     url: `/template/getPageData`,
//     method: "get",
//     params: data,
//   });
// }
